// pages/demo02/demo02.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    num: 0
  },
  inputHandle(e){
    console.log(e.detail.value);
    let val = e.detail.value;
    // this.num = val;
    // this.data.num = val;
    console.log(this.data.num);
    //相似与react的赋值写法
    this.setData({
      num: val
    })
  },

  numHandle(e){
    console.log(e);
    let val = e.currentTarget.dataset.curnum
    this.setData({
      num: this.data.num + val
    })
  }
})